from user import home
import os
import os.path
import sys

#installed?
INSTALL_PATH=os.path.join(sys.prefix,'share','usagi')

if os.path.exists(INSTALL_PATH):
    GFX_PATH=DATA_PATH=INSTALL_PATH
else:
    BASE_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__),".."))
    GFX_PATH  = os.path.join(BASE_PATH,"gfx")
    DATA_PATH = os.path.join(BASE_PATH,"data")


#and go
HOME = os.path.join(home,".usagi")
SQL_PATH = os.path.join(HOME,"mastered_data")
JOUYOU_PATH = os.path.join(DATA_PATH, "jouyou.utf.gz")
KANJI_PATH = os.path.join(DATA_PATH, "kanjidic.utf.gz")
TANGO_PATH = os.path.join(DATA_PATH, "edict.utf.gz")
TANAKA_PATH= os.path.join(DATA_PATH, "tanaka.utf.gz")
ICON_PATH  = os.path.join(GFX_PATH,"usagi_icon.png")

def CREATE_HOME():
    if not os.path.exists(HOME):
        os.mkdir(HOME)

